package com.ruoyi.jvm.classloader;

import sun.misc.Launcher;

import java.net.URL;

public class JDKClassLoader {
    public static void main(String[] args) {
        System.out.println(String.class.getClassLoader());
        System.out.println(com.sun.crypto.provider.DESKeyFactory.class.getClassLoader().getClass().getName());
        System.out.println(JDKClassLoader.class.getClassLoader().getClass().getName());
        System.out.println("----------------------------");
        ClassLoader appClassLoader = ClassLoader.getSystemClassLoader();
        ClassLoader extClassLoader = appClassLoader.getParent();
        ClassLoader bootstrapLoader = extClassLoader.getParent();
        System.out.println("the bootstrapLoader : " + bootstrapLoader);
        System.out.println("the extClassLoader : " + extClassLoader);
        System.out.println("the appClassLoader : " + appClassLoader);
        System.out.println("----------------------------");
        System.out.println("bootstrapLoader加载以下文件：");
        URL[] urLs = Launcher.getBootstrapClassPath().getURLs();
        for(URL u : urLs){
            System.out.println(u);
        }
        System.out.println("----------------------------");

    }
}
